/**
 * @Author 12629
 * @Description：
 */
public class Test_BinaryTree {
    /**
     * @Author 12629
     * @Description：
     */
    public class Test_BinaryTree1 {

        public static void main(String[] args) {
            BinaryTree binaryTree = new BinaryTree();
            BinaryTree.TreeNode root = binaryTree.createTree();

            binaryTree.preOrder(root);
            System.out.println("=====");

            binaryTree.inOrder(root);
            System.out.println("=====");

            binaryTree.postOrder(root);
            System.out.println("=====");


        /*binaryTree.nodeSize(root);

        System.out.println("节点个数："+binaryTree.countNode);*/

            int nodeSize = binaryTree.nodeSize2(root);
            System.out.println("节点个数：" + nodeSize);


        /*int leafSize = binaryTree.getLeafNodeCount(root);
        System.out.println("叶子节点个数："+leafSize);*/

            binaryTree.getLeafNodeCount2(root);

            System.out.println("叶子节点个数：" + binaryTree.leafNodeSize);


            int kLeveNodeSize = binaryTree.getKLeveNodeSize(root, 4);
            System.out.println("第K层的节点个数：" + kLeveNodeSize);


            int height = binaryTree.getHeight(root);
            System.out.println("树的高度：" + height);
        }
    }
}